package org.dr.st_docker.aop.aspectj.config;

import org.dr.st_docker.aop.aspectj.aspect.RoleAspect;
import org.dr.st_docker.aop.aspectj.service.RoleService;
import org.dr.st_docker.aop.aspectj.service.RoleServiceImpl;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.ComponentScan;
import org.springframework.context.annotation.Configuration;
import org.springframework.context.annotation.EnableAspectJAutoProxy;

/**
 * Aop配置类
 * 采用注解java配置
 */
@Configuration
@EnableAspectJAutoProxy//启用Aspectj框架的自动代理
@ComponentScan("org.dr.st_docker.aspectj")
public class AOPConfig {
    @Bean
    public RoleAspect roleAspect() {
        return new RoleAspect();
    }

    @Bean
    public RoleService roleService() {
        return new RoleServiceImpl();//注册name为roleService的bean
    }


}
